﻿using System;
using System.Xml;

namespace Sarnata.Common.Providers.BaseCamp
{
    public abstract class BaseCampObject
    {
        protected T getNodeValue<T>(XmlNode xn)
        {
            if (xn == null) return default(T);
            XmlAttribute xa = xn.Attributes["nil"];
            if (xa != null)
                if (xa.Value == "true") return default(T);
            return (T)Convert.ChangeType(xn.InnerText, typeof(T));
        }
    }
}
